using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using MAPDavy.Entities;
using MAPDavy.Repository.Mapping;

namespace MAPDavy.Repository
{
	public class DBMAPDavyCollegeContext : DbContext
	{
		static DBMAPDavyCollegeContext()
		{ 
			Database.SetInitializer<DBMAPDavyCollegeContext>(null);
            
		}

		public DbSet<AnioLectivo> AniosLectivos { get; set; }
		public DbSet<Grade> Grades { get; set; }
		public DbSet<Log> Logs { get; set; }
		public DbSet<Matricula> Matriculas { get; set; }
		public DbSet<Score> Scores { get; set; }
		public DbSet<Seccion> Seccions { get; set; }
		public DbSet<SeccionTutor> SeccionTutors { get; set; }
		public DbSet<Student> Students { get; set; }
		public DbSet<Subject> Subjects { get; set; }
		public DbSet<Term> Terms { get; set; }
		public DbSet<Test> Tests { get; set; }
		public DbSet<TestGrade> TestGrades { get; set; }
		public DbSet<Tutor> Tutors { get; set; }
        public DbSet<MAP> MAPs { get; set; }
        public DbSet<ColorCode> ColorCodes { get; set; }
        public DbSet<RITColorCode> RITColorCodes { get; set; }
        public DbSet<ParameterReport> ParameterReports { get; set; }
        public DbSet<Report> Reports { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
		{
            this.Configuration.LazyLoadingEnabled = false;

            modelBuilder.Conventions.Remove<IncludeMetadataConvention>();
			modelBuilder.Configurations.Add(new AnioLectivoMap());
			modelBuilder.Configurations.Add(new GradeMap());
			modelBuilder.Configurations.Add(new LogMap());
			modelBuilder.Configurations.Add(new MatriculaMap());
			modelBuilder.Configurations.Add(new ScoreMap());
			modelBuilder.Configurations.Add(new SeccionMap());
			modelBuilder.Configurations.Add(new SeccionTutorMap());
			modelBuilder.Configurations.Add(new StudentMap());
			modelBuilder.Configurations.Add(new SubjectMap());
			modelBuilder.Configurations.Add(new TermMap());
			modelBuilder.Configurations.Add(new TestMap());
			modelBuilder.Configurations.Add(new TestGradeMap());
			modelBuilder.Configurations.Add(new TutorMap());
            modelBuilder.Configurations.Add(new MAPMap());
            modelBuilder.Configurations.Add(new ColorCodeMap());
            modelBuilder.Configurations.Add(new RITColorCodeMap());
            modelBuilder.Configurations.Add(new ParameterReportMap());
            modelBuilder.Configurations.Add(new ReportMap());
		}
	}
}

